package com.ckh.springboot.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ckh.springboot.entity.HomeWorkTeacher;
import com.ckh.springboot.entity.NoticeClass;
import com.ckh.springboot.entity.User;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.Date;
import java.util.List;

public interface HomeWorkTeacherMapper extends BaseMapper<HomeWorkTeacher> {
    @Select("select * from sys_homework_teacher where teacher_id = #{id}")
    List<HomeWorkTeacher> getHomeWorkTeacherList (Integer id) ;
    @Select("select * from sys_homework_teacher where classid = #{id}")
    List<HomeWorkTeacher> getClassHomeWork (Integer id) ;

    @Update("insert into  sys_homework_teacher ( classid,teacher_id,title,text , submitcount ,create_time  , banji) values (#{classId} " +
            ", #{teachId} , #{title} , #{text} , #{submitcount} , #{createtime} , #{banji})")
    int addHomeWorkTeacher(Integer classId, Integer teachId , String title , String text , Integer submitcount , Date createtime , String banji );

    @Update("update from sys_homework_teacher set teacher_id =#{tid} , submitcount = #{submitcount}")
    int addSubmitCount(Integer tid,Integer submitcount);
}
